package Demo1;

/**
 * 重载
 */
public class test2 {
    public static void eat(int num) {
        System.out.println("吃了" + num + "个");
    }
    public static void eat(String name) {
        System.out.println("吃了" + name);
    }
    public static void eat(String name,int num) {
        System.out.println("吃了" + num + "个" + name);
    }
    public static String eat() {
        System.out.println("吃吃吃吃吃吃吃吃吃");
        return null;
    }
    public static void main(String[] args) {
        eat();
        eat(1);
        eat("苹果");
        eat("苹果",1);
    }
}
